main(l,m,n){char a[90],b[90],s[90],c[90];for(gets(a),n=1;~scanf("%s%s",s,c);printf("%d %s\n",n++,s[0]!=48?s:s+1)){memset(a,48,90);memset(b,48,90);l=strlen(s);m=strlen(c);l>m?(strcpy(a+1,s),strcpy(b+l-m+1,c)):(strcpy(a+m-l+1,s),strcpy(b+1,c),l=m);for(m=0;m<=l;a[m]-=48,b[m++]-=48);memset(c,0,90);for(m=l;~m;m--){c[m-1]=(a[m]&b[m])|(b[m]&c[m])|(c[m]&a[m]);s[m]=a[m]^b[m]^c[m];}for(m=0;m<=l;s[m++]+=48);}}
